﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommentPost
{
    public partial class Summary : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected string DidNotLikeMyBlog()
        {
            StringBuilder stringBuilder = new StringBuilder();
            IEnumerable<Comment> noLikey = 
                CommentsCollection.GetCommentsCollection().GetAllComments().Where(r => r.LikedPost.HasValue&& !r.LikedPost.Value);

            foreach (Comment comment in noLikey)
            {
                stringBuilder.Append(String.Format("<tr><td>{0}</td><td>{1}</td>", comment.PosterName, comment.PosterEmail));
            }

            return stringBuilder.ToString();
        }
    }
}